var rvm_multiple = Class.create();
rvm_multiple.prototype = {
	

	total : null,
	
	container : null,
	action: null,
	params: null,
	
	
	//constructor
	initialize: function(cont, act, parm, text){
		this.container = cont;
		this.action = act;
		this.params = parm;
		this.linkText = text;
		
		a = new Element('a');
		a.update(this.linkText);
		a.observe('click', this._add.bind(this));
		
		$(this.container).insert({before:a});
		this.total=0;
	},
	
	_add: function(){
		dest = new Element('div');
		dataDest = new Element('div', {'id': this.container+'data' + this.total});

		close = new Element('div', {'class': 'cancel_boton'});
		a = new Element('a');
		a.update("X");
		a.observe('click', this._close.bind(a));

		close.insert({bottom:a});

		
		dest.insert({top:close});

		dest.insert({bottom:dataDest});
		
		
		$(this.container).insert({bottom:dest});

		dom_insert(this.action, this.params + '&sufix=' + this.total, dataDest, 'bottom', null);
		this.total++;
		
	
		
	},
	
	_close: function(){
		this.up(1).remove();
	}
}
